home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2001 Haziran
/
CHIP Haziran2001.iso
/
prog
/
share
/
04
/
setup.exe
/
MM6.Cab
/
F1625_BrwsrSwtch.scpt.F6A680DD_F3FB_4CF3_BABB_0D0F06E630F5
< prev
next >
Wrap
Text File
|
2000-08-17
|
1KB
|
45 lines
function CSBrowserSwitch(action) {
var bAgent = window.navigator.userAgent;
var bAppName = window.navigator.appName;
var isNS = (bAppName.indexOf("Netscape") >= 0);
var isIE = (bAppName.indexOf("Explorer") >= 0);
var isWin = (bAgent.indexOf("Win") >= 0);
var isMac = (bAgent.indexOf("Mac") >= 0);
var vers = 0;
var versIdx = (bAgent.indexOf("Mozilla/"));
if(versIdx >= 0)
{
var sstr = bAgent.substring(versIdx + 8, versIdx + 9);
vers = parseInt(sstr) - 2;
}
var url = action[1];
var platform = action[2];
var versVec;
if(platform)
{
if(isNS && isMac) versVec = action[3];
if(isIE && isMac) versVec = action[5];
if(isNS && isWin) versVec = action[4];
if(isIE && isWin) versVec = action[6];
}
else
{
if(isNS) versVec = action[3];
if(isIE) versVec = action[4];
}
if(vers > (versVec.length-1))
vers = versVec.length-1;
if(versVec[vers] == 0)
{
location = url;
CSStopExecution = true;
}
}